# Create your views here.
from django.http import HttpResponse
from school.models import School
from django.template import Context, loader
from django.shortcuts import render_to_response
from school.models import Profile, District

def schools(request,school_id):
    our_school = School.objects.filter(id=school_id)[0]
    our_profiles = our_school.profile.all()
    template = loader.get_template('school/schools.html')
    context = Context({
        'our_school': our_school,
        'our_profiles': our_profiles,
    })


    return HttpResponse(template.render(context))

def home(request):
    our_profiles = Profile.objects.all()
    our_districts = District.objects.all()
    context = Context({
        'our_profiles': our_profiles,
        'our_districts': our_districts,
    })   
    
    return render_to_response('school/forms.html', context)
    
    